<?php

/**
 * MovimientosMensualAgua form base class.
 *
 * @method MovimientosMensualAgua getObject() Returns the current form's model object
 *
 * @package    sf_sandbox
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseMovimientosMensualAguaForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                      => new sfWidgetFormInputHidden(),
      'fecha_carga'             => new sfWidgetFormDateTime(),
      'obs'                     => new sfWidgetFormInputText(),
      'valor'                   => new sfWidgetFormInputText(),
      'concepto_id'             => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Concepto'), 'add_empty' => false)),
      'unidad_funcional_id'     => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('UnidadFuncional'), 'add_empty' => false)),
      'comprobante_imputado_id' => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'id'                      => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'fecha_carga'             => new sfValidatorDateTime(array('required' => false)),
      'obs'                     => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'valor'                   => new sfValidatorNumber(),
      'concepto_id'             => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Concepto'))),
      'unidad_funcional_id'     => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('UnidadFuncional'))),
      'comprobante_imputado_id' => new sfValidatorInteger(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('movimientos_mensual_agua[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'MovimientosMensualAgua';
  }

}
